<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class AdminMenuSeeder extends Seeder
{
    /**
     * @var array
     */
    public $menu = [
        ['title' => '用户', 'order' => 8, 'icon' => 'fa-users', 'uri' => 'users'],
        ['title' => '单位', 'order' => 9, 'icon' => 'fa-briefcase', 'uri' => 'units'],
        ['title' => '题库分类', 'order' => 10, 'icon' => 'fa-folder-open', 'uri' => 'categories'],
        ['title' => '题库', 'order' => 11, 'icon' => 'fa-archive', 'uri' => 'questions'],
        ['title' => '统计', 'order' => 12, 'icon' => 'fa-area-chart', 'uri' => 'statistics'],
        ['title' => '设置', 'order' => 13, 'icon' => 'fa-cog', 'uri' => 'settings'],
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach ($this->menu as $item) {
            DB::table('admin_menu')->updateOrInsert(['uri' => $item['uri']], $item);
        }
    }
}
